import QtQuick 2.12
import QtQuick.Window 2.12
import TestModule 1.0

Window {
    width: 640
    height: 480
    visible: true
    title: qsTr("Hello World")


    ListView{
        anchors.fill: parent
        model:TestModel{
            id:testmodel
            datas: [
            TestItem{
                name: "zhangsan"
                value: 123
                },
            TestItem{
                name: "zhangsan1"
                value: 1234
                }
            ]

        }

        delegate: Text{
        text:  name + "  " + value

            MouseArea{
                anchors.fill: parent
                onClicked: {
                  testmodel.append({name:"qml",value:123})
                }
            }
        }

    }
}
